/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pluginGraphe;

import application.ViewManager;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Observable;
import javax.swing.JTable;
import javax.swing.event.TableModelEvent;
import javax.swing.event.TableModelListener;

/**
 *
 * @author mazid
 */
public final class PlageCellule extends Observable implements TableModelListener, Serializable{
    private static final long serialVersionUID = 307967695L;
    private int maxVal = 30 ;
    private int[] rows;
    private int[] cols;
    
    public PlageCellule(){
        cols = ViewManager.getInstance().getJTable().getSelectedColumns();
        rows = ViewManager.getInstance().getJTable().getSelectedRows();
    }
    // pour recuperer les valeurs
  
    public int getMaximum() {
        return maxVal;
    }

    public int[] getRows() {
        return rows;
        
    }

    public int[] getCols() {
        return cols;
    }

    // pour recuperer les valeurs a l'indice row et col
    public int getValeur(int row, int col){
        
        return Integer.parseInt(ViewManager.getInstance().getJTable().getValueAt(row, col).toString());
        
    }

    @Override
    public void tableChanged(TableModelEvent e) {
        
        notifyObservers();
    }
    
     
}
